"use strict";
class Package {
    // 构造函数
    constructor(weight) {
        this.weight = weight;
    }
    // 具体函数
    printPackage() {
        console.log(`包裹${this.calculate()}`);
    }
}
class StandardPackage extends Package {
    constructor(weight, price) {
        super(weight);
        this.price = price;
    }
    // 重写抽象函数
    calculate() {
        return this.weight * this.price;
    }
}
// 获取实例
const s1 = new StandardPackage(10, 2);
s1.printPackage();
